package com.kfm.spring.service.impl;

import com.kfm.spring.dao.IAccountDao;
import com.kfm.spring.service.IAccountService;

public class AccountServiceImpl implements IAccountService {

    private IAccountDao dao ;//= new AccountDaoImpl();

    public void setDao(IAccountDao dao) {
        System.out.println("setDao方法执行了");
        this.dao = dao;
    }

    public AccountServiceImpl(IAccountDao dao){
        this.dao = dao;
    }

    public AccountServiceImpl(){
        System.out.println("AccountServiceImpl对象创建了");
    }

    @Override
    public int saveAccount() {
        // 创建账户对象

        // 调用dao层的方法保存账户
        return dao.saveAccount();
    }
}
